<!--包含头部文件-->
{include file="public/header" /}
<body>
<nav class="breadcrumb"><i class="Hui-iconfont">&#xe67f;</i> 首页 <span class="c-gray en">&gt;</span> 产品管理 <span class="c-gray en">&gt;</span> 品牌管理 <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a></nav>
<div class="page-container">
	<div class="text-c">
		<form class="Huiform" method="post" action="{:url('banner/add')}" target="_self" enctype="multipart/form-data">
			<span class="btn-upload form-group">
			<input class="input-text upload-url" type="text" name="" id="uploadfile-2" readonly style="width:200px">
			<a href="javascript:void();" class="btn btn-primary upload-btn"><i class="Hui-iconfont">&#xe642;</i> 上传轮播图</a>
			<input type="file" multiple name="banner" class="input-file">
			</span> <button type="submit" class="btn btn-success" id="" name=""><i class="Hui-iconfont">&#xe600;</i> 添加</button>
		</form>
	</div>
	<div class="cl pd-5 bg-1 bk-gray mt-20"> <span class="l"><a href="javascript:;" onclick="datadel()" class="btn btn-danger radius"><i class="Hui-iconfont">&#xe6e2;</i> 批量删除</a></span> <span class="r">共有数据：<strong>{$count}</strong> 条</span> </div>
	<div class="mt-20">
		<table class="table table-border table-bordered table-bg table-sort">
			<thead>
				<tr class="text-c">
					<th width="25"><input type="checkbox" name="" value=""></th>
					<th width="80">ID</th>
					<th width="100">排序</th>
					<th width="200">LOGO</th>
					<th width="220">地址(url)</th>
					<th>状态</th>
					<th width="150">操作</th>
				</tr>
			</thead>
			<tbody>
				{volist name="bannerlist" id="vo"}
				<tr class="text-c">
					<td><input name="" type="checkbox" value=""></td>
					<td>{$vo.id}</td>
					<td class="listorder"><input type="text" attr-id="{$vo.id}" class="input-text text-c" value="{$vo.listorder}"></td>
					<td><img src="{$vo.src}" height="60"></td>
					<td class="text-c">{$vo.url}</td>
					<td class="td-status"><a href="{:url('banner/status',['id'=>$vo.id,'status'=>$vo.status == 1 ? 0 : 1])}" title="点击修改状态">{$vo.status|banner}</a></td>
					<td class="f-14 product-brand-manage"><a style="text-decoration:none" href="{:url('banner/edit',['id'=>$vo.id])}" title="编辑"><i class="Hui-iconfont">&#xe6df;</i></a> <a style="text-decoration:none" class="ml-5" onClick="o2o_del('{:url('banner/status',['id'=>$vo.id,'status'=>-1])}')" href="javascript:;" title="删除"><i class="Hui-iconfont">&#xe6e2;</i></a></td>
				</tr>
				{/volist}
			</tbody>
		</table>
	</div>
</div>
<div class="cl pd-5 bg-1 bk-gray mt-20 tp5-o2o">{$bannerlist->render()}</div>
<!--包含头部文件-->
{include file="public/footer" /}
<script>
var SCOPE = {
	'listorder_url': "{:url('banner/listorder')}",
  };
  $('.listorder input').blur(function() { 
    //获取主键id
    var id = $(this).attr('attr-id');
    // 获取排序的值
    var listorder = $(this).val();

    var postData = {
        'id' : id,
        'listorder':listorder,
    };
    var url = SCOPE.listorder_url;
    // 抛送http
    $.post(url, postData, function(result){
        // 逻辑
        if(result.code == 1) {
            location.href=result.data;
        }else {
            alert(result.msg);
        }
    },"json");
});
</script>	
</body>
</html>